﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Liquid.Windows {
	public sealed class WeakReference<T> where T : class {
		WeakReference wr;

		public WeakReference(T target) {
			wr = new WeakReference(target);
		}

		public WeakReference(T target, bool trackResurection) {
			wr = new WeakReference(target, trackResurection);
		}
		public bool TrackResurrection { get { return wr.TrackResurrection; } }
		public bool IsAlive { get { return wr.IsAlive; } }
		public T Target { get { return (T)wr.Target; } }

		public static explicit operator WeakReference(WeakReference<T> from) {
			return from.wr;
		}
	}
}
